package cn.ad.server.persistence.dao;

import java.util.List;

import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.FetchType;
import org.springframework.stereotype.Component;

import cn.ad.server.domain.ad.PlatformAdspaceMap;

@Component
public interface PlatformAdspaceMapDao {
	
	@Results(value = { 
			@Result(column = "id", property = "id", id=true),
			@Result(column = "channel_id", property = "channelId"),
			@Result(column = "platform_tag_id", property = "platformTagId"),
			@Result(column = "platform_id", property = "platformId"),
			@Result(column = "ad_space_id", property = "adSpaceId"),
			@Result(column = "status", property = "status"),
			@Result(column = "create_time", property = "createTime"),
			@Result(column = "update_time", property = "updateTime") })
	@Select("select * from platform_adspace_map")
	public List<PlatformAdspaceMap> findAll();
	
	@Results(value = { 
			@Result(column = "id", property = "id", id=true),
			@Result(column = "channel_id", property = "channelId"),
			@Result(column = "platform_tag_id", property = "platformTagId"),
			@Result(column = "platform_id", property = "platformId"),
			@Result(column = "ad_space_id", property = "adSpaceId"),
			@Result(column = "status", property = "status"),
			@Result(column = "create_time", property = "createTime"),
			@Result(column = "update_time", property = "updateTime") })
	@Select("select * from platform_adspace_map where update_time >= #{value}")
	public List<PlatformAdspaceMap> findAfterTime(String warmUpTime);

}
